<?php

namespace App\Modules\Admin\Models;

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class AdminMenu
 * *
 * @property $menu_uid  菜单ID
 * @property $parent_uid  父菜单ID
 * @property $title  标题
 * @property $path  路径
 * @property $icon  图标
 * @property $permission  权限标识
 * @property $sort  排序
 * @property $type  类型 1: 菜单 2: 功能
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
 *
 * @package  App\Modules\Admin\Models
 * @mixin \Illuminate\Database\Eloquent\Builder
 */
class AdminMenu extends Model
{
    use SoftDeletes;

    protected $table = 'admin_menus';

    protected $fillable = ['menu_uid', 'parent_uid', 'title', 'path', 'icon', 'permission', 'sort', 'type'];

    protected function serializeDate(DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

}
